#include<iostream>
using namespace std;
#include<vector>
int searchInsert(vector<int>& nums, int target) {
    int left = -1;
    int right = nums.size();
    int middle = (left + right) / 2;

    while (left < right - 1)
    {
        middle = (left + right) / 2;
        if (nums[middle] > target)
        {
            right = middle;
        }
        else if (nums[middle] < target)
        {
            left = middle;
        }
        else {
            return middle;
        }
    }
    return left + 1;
}
int main()
{

}